#猜拳游戏
import random
n = 1 # 游戏次数
p_count = 0 # 玩家赢的次数
c_count = 0 # 电脑赢的次数
while n <= 3:
    ran = random.randint(1, 3)
    guess = int(input("请出拳：1.剪刀 2.石头 3.布"))
    if (guess == 1 and ran == 3) or (guess == 2 and ran == 1) or (guess == 3 and ran == 2):
        print("恭喜你赢了")
        p_count += 1
    elif guess == ran:
        print("平局,再来一局")
        n -= 1
    else:
        print("你输了")
        c_count += 1
    n += 1
print("你赢了%d次，电脑赢了%d次" % (p_count, c_count))